package srx.open.com.fragment;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;

import srx.open.com.bean.SrxApplication;
import srx.open.com.utils.BaiDuLbsHelper;
import srx.open.com.utils.DataBaseHelper;

public abstract class BaseFragment extends Fragment {

	/* 附近课程刷新 */
	public static final int DOWN_PULL_STATE_UPDAE = 10000;
	public static final int UP_PULL_STATE_UPDATE = 10001;

	public Context mContext;

	public DataBaseHelper mDataBaseHelper; // 数据库操作.
	public BaiDuLbsHelper mBaiDuLbsHelper; // 百度定位.
	public SrxApplication mSrxApplication;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		mContext = getActivity().getApplicationContext();
		/* */
		mSrxApplication = (SrxApplication) getActivity()
				.getApplication();
		/* 获取 数据库 DataBaseHelper */
		mDataBaseHelper = mSrxApplication.mDataBaseHelper;
		/* 获取百度定位变量 */
		mBaiDuLbsHelper = mSrxApplication.mBaiDuLbsHelper;
		initAllDatas();
	}

	public void initAllDatas() {
	}

	/**
	 *  打开 activity.
	 */
	public void openActivity(Class<?> cls) {
		Intent intents = new Intent(mContext, cls);
		startActivity(intents);
	}

}
